package com.mobile.collect.beans;

import android.os.Parcel;
import android.os.Parcelable;

import com.mobile.collect.view.MyPointView;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Transient;

@Entity
public class DevicePointInfo implements Parcelable ,Cloneable{
    @Id(autoincrement = true)
    private Long _ID;
    private Long parentId;

    private float scaleX;
    private float scaleY;
    private int viewWidth;
    @Transient
    private int realViewWidth;
    @Transient
    private int realViewHeight;
    private int viewHeight;
    private int screenX;
    private int screenY;

    @Transient
    private int realScreenX;
    @Transient
    private int realSCreenY;

    private String pointDircetion;//标签方向
    private int direction;
    private int bgType;//标签方向
    private int lineType;
    private String lineType2;
    private String deviceName;
    private String addressNo;
    private String expendNo;
    private String diameter;
    private String distence;
    private String height;
    private String type;
    private String typeEn;
    private String childType;
    private String childTypeEn;//标签的英文
    private String checkHardType;//难于检测
    private String checkHardReason;//难于检测原因
    private String dangerCheck;//险于检测
    private String dangerCheckReaseon;//险于检测
    private String heatPreservation;//保温
    private String additionalDes;//附加描述
    private String labelName;//附加描述
    private int deviceCount;//
    private String status;//
    private long createTime;//
    private boolean isNewPoint;


    @Transient
    private MyPointView pointView;

    @Transient
    private boolean canMove;
    @Override
    public String toString() {
        return "DevicePointInfo{" +
                "_ID=" + _ID +
                ", parentId=" + parentId +
                ", scaleX=" + scaleX +
                ", scaleY=" + scaleY +
                ", viewWidth=" + viewWidth +
                ", viewHeight=" + viewHeight +
                ", screenX=" + screenX +
                ", screenY=" + screenY +
                ", pointDircetion='" + pointDircetion + '\'' +
                ", direction=" + direction +
                ", bgType=" + bgType +
                ", lineType=" + lineType +
                ", pointView=" + pointView +
                ", canMove=" + canMove +
                ", deviceName='" + deviceName + '\'' +
                ", addressNo='" + addressNo + '\'' +
                ", expendNo='" + expendNo + '\'' +
                ", diameter='" + diameter + '\'' +
                ", distence='" + distence + '\'' +
                ", height='" + height + '\'' +
                ", type='" + type + '\'' +
                ", typeEn='" + typeEn + '\'' +
                ", childType='" + childType + '\'' +
                ", childTypeEn='" + childTypeEn + '\'' +
                ", checkHardType='" + checkHardType + '\'' +
                ", checkHardReason='" + checkHardReason + '\'' +
                ", dangerCheck='" + dangerCheck + '\'' +
                ", dangerCheckReaseon='" + dangerCheckReaseon + '\'' +
                ", heatPreservation='" + heatPreservation + '\'' +
                ", additionalDes='" + additionalDes + '\'' +
                ", labelName='" + labelName + '\'' +
                ", deviceCount=" + deviceCount +
                ", status='" + status + '\'' +
                ", status='" + status + '\'' +
                ", isNewPoint=" + isNewPoint +
                '}';
    }

    public DevicePointInfo() {
    }

    public Long get_ID() {
        return _ID;
    }

    public void set_ID(Long _ID) {
        this._ID = _ID;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getAddressNo() {
        return addressNo;
    }

    public void setAddressNo(String addressNo) {
        this.addressNo = addressNo;
    }

    public String getExpendNo() {
        return expendNo;
    }

    public void setExpendNo(String expendNo) {
        this.expendNo = expendNo;
    }

    public String getDiameter() {
        return diameter;
    }

    public void setDiameter(String diameter) {
        this.diameter = diameter;
    }

    public String getDistence() {
        return distence;
    }

    public void setDistence(String distence) {
        this.distence = distence;
    }

    public String getHeight() {
        return height;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getChildType() {
        return childType;
    }

    public void setChildType(String childType) {
        this.childType = childType;
    }

    public String getCheckHardType() {
        return checkHardType;
    }

    public void setCheckHardType(String checkHardType) {
        this.checkHardType = checkHardType;
    }

    public String getCheckHardReason() {
        return checkHardReason;
    }

    public void setCheckHardReason(String checkHardReason) {
        this.checkHardReason = checkHardReason;
    }

    public String getDangerCheck() {
        return dangerCheck;
    }

    public void setDangerCheck(String dangerCheck) {
        this.dangerCheck = dangerCheck;
    }

    public String getHeatPreservation() {
        return heatPreservation;
    }

    public void setHeatPreservation(String heatPreservation) {
        this.heatPreservation = heatPreservation;
    }

    public String getAdditionalDes() {
        return additionalDes;
    }

    public void setAdditionalDes(String additionalDes) {
        this.additionalDes = additionalDes;
    }


    public MyPointView getPointView() {
        return pointView;
    }

    public void setPointView(MyPointView pointView) {
        this.pointView = pointView;
    }

    public float getScaleX() {
        return scaleX;
    }

    public void setScaleX(float scaleX) {
        this.scaleX = scaleX;
    }

    public float getScaleY() {
        return scaleY;
    }

    public void setScaleY(float scaleY) {
        this.scaleY = scaleY;
    }

    public String getPointDircetion() {
        return pointDircetion;
    }

    public void setPointDircetion(String pointDircetion) {
        this.pointDircetion = pointDircetion;
    }

    public int getBgType() {
        return bgType;
    }

    public void setBgType(int bgType) {
        this.bgType = bgType;
    }

    public int getLineType() {
        return lineType;
    }

    public void setLineType(int lineType) {
        this.lineType = lineType;
    }

    public String getDangerCheckReaseon() {
        return this.dangerCheckReaseon;
    }

    public void setDangerCheckReaseon(String dangerCheckReaseon) {
        this.dangerCheckReaseon = dangerCheckReaseon;
    }

    public String getLabelName() {
        return this.labelName;
    }

    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }


    public int getDeviceCount() {
        return deviceCount;
    }

    public void setDeviceCount(int deviceCount) {
        this.deviceCount = deviceCount;
    }


    public int getViewWidth() {
        return this.viewWidth;
    }

    public void setViewWidth(int viewWidth) {
        this.viewWidth = viewWidth;
    }

    public int getViewHeight() {
        return this.viewHeight;
    }

    public void setViewHeight(int viewHeight) {
        this.viewHeight = viewHeight;
    }

    public int getScreenX() {
        return this.screenX;
    }

    public void setScreenX(int screenX) {
        this.screenX = screenX;
    }

    public int getScreenY() {
        return this.screenY;
    }

    public void setScreenY(int screenY) {
        this.screenY = screenY;
    }

    public boolean getIsNewPoint() {
        return this.isNewPoint;
    }

    public boolean isCanMove() {
        return canMove;
    }

    public void setCanMove(boolean canMove) {
        this.canMove = canMove;
    }

    public int getDirection() {
        return direction;
    }

    public void setDirection(int direction) {
        this.direction = direction;
    }

    public void setIsNewPoint(boolean isNewPoint) {
        this.isNewPoint = isNewPoint;
    }


    @Override
    protected DevicePointInfo clone(){
        DevicePointInfo pointInfo = null;
        try{
            pointInfo = (DevicePointInfo)super.clone();
        }catch(CloneNotSupportedException e) {
            e.printStackTrace();
        }

        return pointInfo;
    }

    public DevicePointInfo getNewPointInfo(){
        return clone();
    }


    public String getChildTypeEn() {
        return childTypeEn;
    }

    public void setChildTypeEn(String childTypeEn) {
        this.childTypeEn = childTypeEn;
    }

    public String getTypeEn() {
        return typeEn;
    }

    public void setTypeEn(String typeEn) {
        this.typeEn = typeEn;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    //    public boolean isSelected() {
//        return isSelected;
//    }
//
//    public void setSelected(boolean selected) {
//        isSelected = selected;
//    }

    @Generated(hash = 413492334)
    public DevicePointInfo(Long _ID, Long parentId, float scaleX, float scaleY, int viewWidth,
            int viewHeight, int screenX, int screenY, String pointDircetion, int direction,
            int bgType, int lineType, String lineType2, String deviceName, String addressNo,
            String expendNo, String diameter, String distence, String height, String type,
            String typeEn, String childType, String childTypeEn, String checkHardType,
            String checkHardReason, String dangerCheck, String dangerCheckReaseon,
            String heatPreservation, String additionalDes, String labelName, int deviceCount,
            String status, long createTime, boolean isNewPoint) {
        this._ID = _ID;
        this.parentId = parentId;
        this.scaleX = scaleX;
        this.scaleY = scaleY;
        this.viewWidth = viewWidth;
        this.viewHeight = viewHeight;
        this.screenX = screenX;
        this.screenY = screenY;
        this.pointDircetion = pointDircetion;
        this.direction = direction;
        this.bgType = bgType;
        this.lineType = lineType;
        this.lineType2 = lineType2;
        this.deviceName = deviceName;
        this.addressNo = addressNo;
        this.expendNo = expendNo;
        this.diameter = diameter;
        this.distence = distence;
        this.height = height;
        this.type = type;
        this.typeEn = typeEn;
        this.childType = childType;
        this.childTypeEn = childTypeEn;
        this.checkHardType = checkHardType;
        this.checkHardReason = checkHardReason;
        this.dangerCheck = dangerCheck;
        this.dangerCheckReaseon = dangerCheckReaseon;
        this.heatPreservation = heatPreservation;
        this.additionalDes = additionalDes;
        this.labelName = labelName;
        this.deviceCount = deviceCount;
        this.status = status;
        this.createTime = createTime;
        this.isNewPoint = isNewPoint;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this._ID);
        dest.writeValue(this.parentId);
        dest.writeFloat(this.scaleX);
        dest.writeFloat(this.scaleY);
        dest.writeInt(this.viewWidth);
        dest.writeInt(this.viewHeight);
        dest.writeInt(this.screenX);
        dest.writeInt(this.screenY);
        dest.writeString(this.pointDircetion);
        dest.writeInt(this.direction);
        dest.writeInt(this.bgType);
        dest.writeInt(this.lineType);
        dest.writeByte(this.canMove ? (byte) 1 : (byte) 0);
        dest.writeString(this.deviceName);
        dest.writeString(this.addressNo);
        dest.writeString(this.expendNo);
        dest.writeString(this.diameter);
        dest.writeString(this.distence);
        dest.writeString(this.height);
        dest.writeString(this.type);
        dest.writeString(this.typeEn);
        dest.writeString(this.childType);
        dest.writeString(this.childTypeEn);
        dest.writeString(this.checkHardType);
        dest.writeString(this.checkHardReason);
        dest.writeString(this.dangerCheck);
        dest.writeString(this.dangerCheckReaseon);
        dest.writeString(this.heatPreservation);
        dest.writeString(this.additionalDes);
        dest.writeString(this.labelName);
        dest.writeInt(this.deviceCount);
        dest.writeString(this.status);
        dest.writeByte(this.isNewPoint ? (byte) 1 : (byte) 0);
    }



    public long getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getLineType2() {
        return this.lineType2;
    }

    public void setLineType2(String lineType2) {
        this.lineType2 = lineType2;
    }

    public int getRealScreenX() {
        return realScreenX;
    }

    public void setRealScreenX(int realScreenX) {
        this.realScreenX = realScreenX;
    }

    public int getRealSCreenY() {
        return realSCreenY;
    }

    public void setRealSCreenY(int realSCreenY) {
        this.realSCreenY = realSCreenY;
    }

    public int getRealViewWidth() {
        return realViewWidth;
    }

    public void setRealViewWidth(int realViewWidth) {
        this.realViewWidth = realViewWidth;
    }

    public int getRealViewHeight() {
        return realViewHeight;
    }

    public void setRealViewHeight(int realViewHeight) {
        this.realViewHeight = realViewHeight;
    }

    protected DevicePointInfo(Parcel in) {
        this._ID = (Long) in.readValue(Long.class.getClassLoader());
        this.parentId = (Long) in.readValue(Long.class.getClassLoader());
        this.scaleX = in.readFloat();
        this.scaleY = in.readFloat();
        this.viewWidth = in.readInt();
        this.viewHeight = in.readInt();
        this.screenX = in.readInt();
        this.screenY = in.readInt();
        this.pointDircetion = in.readString();
        this.direction = in.readInt();
        this.bgType = in.readInt();
        this.lineType = in.readInt();
        this.canMove = in.readByte() != 0;
        this.deviceName = in.readString();
        this.addressNo = in.readString();
        this.expendNo = in.readString();
        this.diameter = in.readString();
        this.distence = in.readString();
        this.height = in.readString();
        this.type = in.readString();
        this.typeEn = in.readString();
        this.childType = in.readString();
        this.childTypeEn = in.readString();
        this.checkHardType = in.readString();
        this.checkHardReason = in.readString();
        this.dangerCheck = in.readString();
        this.dangerCheckReaseon = in.readString();
        this.heatPreservation = in.readString();
        this.additionalDes = in.readString();
        this.labelName = in.readString();
        this.deviceCount = in.readInt();
        this.status = in.readString();
        this.isNewPoint = in.readByte() != 0;
    }

    public static final Creator<DevicePointInfo> CREATOR = new Creator<DevicePointInfo>() {
        @Override
        public DevicePointInfo createFromParcel(Parcel source) {
            return new DevicePointInfo(source);
        }

        @Override
        public DevicePointInfo[] newArray(int size) {
            return new DevicePointInfo[size];
        }
    };
}
